#pragma once
#ifndef __BUILDER_H__
#define __BUILDER_H__

namespace builder
{
	typedef enum ManTypeTag
	{
		FAT_MAN,
		THIN_MAN,
		NORMAL_MAN
	} ManType;

	class Man
	{
	public:
		void setHead(ManType type) { m_type = type; }
		void setBody(ManType type) { m_type = type; }
		void setLeftHand(ManType type) { m_type = type; }
		void setRightHand(ManType type) { m_type = type; }
		void setLeftFoot(ManType type) { m_type = type; }
		void setRightFoot(ManType type) { m_type = type; }
		void showMan();

	private:
		ManType m_type;
	};



	class Builder
	{

	public:
		virtual void BuildHead() {}
		virtual void BuildBody() {}
		virtual void BuildLeftHand() {}
		virtual void BuildRightHand() {}
		virtual void BuildLeftFoot() {}
		virtual void BuildRightFoot() {}
		virtual Man* GetMan() { return nullptr; }
	};


	class FatManBuilder :public Builder
	{

	public:
		FatManBuilder() { m_FatMan = new Man(); }
		void BuildHead() { m_FatMan->setHead(FAT_MAN); }
		void BuildBody() { m_FatMan->setBody(FAT_MAN); }
		void BuildLeftHand() { m_FatMan->setLeftHand(FAT_MAN); }
		void BuildRightHand() { m_FatMan->setRightHand(FAT_MAN); }
		void BuildLeftFoot() { m_FatMan->setLeftFoot(FAT_MAN); }
		void BuildRightFoot() { m_FatMan->setRightFoot(FAT_MAN); }
		Man* GetMan() { return m_FatMan; }

	private:
		Man* m_FatMan;
	};

	class ThinManBuilder :public Builder
	{
	public:
		ThinManBuilder() { m_ThinMan = new Man(); }
		void BuildHead() { m_ThinMan->setHead(THIN_MAN); }
		void BuildBody() { m_ThinMan->setBody(THIN_MAN); }
		void BuildLeftHand() { m_ThinMan->setLeftHand(THIN_MAN); }
		void BuildRightHand() { m_ThinMan->setRightHand(THIN_MAN); }
		void BuildLeftFoot() { m_ThinMan->setLeftFoot(THIN_MAN); }
		void BuildRightFoot() { m_ThinMan->setRightFoot(THIN_MAN); }
		Man* GetMan() { return m_ThinMan; }

	private:
		Man* m_ThinMan;

	};


	// Director
	class Director
	{
	public:
		Director(Builder* builder) { m_Builder = builder; }
		void CreateMan();

	private:
		Builder* m_Builder;
	};



}

#endif // !__BUILDER_H__
